package org.jugile.proto2.domain;

import org.jugile.daims.Bo;
import org.jugile.daims.anno.*;
import org.jugile.util.Time;

@DaimsObject(table="person_t")
public class PersonBase extends Bo {

	@Fld
	private int age;
	public int getAge() { return age; }
	public Person setAge(int v) { return (Person)setFld("age",v); }

	@Fld
	private Time ts;
	public Time getTs() { return ts; }
	public Person setTs(Time v) { return (Person)setFld("ts",v); }

	@Fld(size=300)
	private String name;
	public String getName() { return name; }
	public Person setName(String v) { return (Person)setFld("name",v); }

	@ConnectionN1(c="cPersons")
	private Family family;
	public Family getFamily() { return (Family)getN1("family"); }
	public Person setFamily(Family o) { return (Person)setN1("family",o); }

	@ConnectionNN(c="nFriendPersons",first=true,table="map_person_2friend_family")
	private FamilyCollection nFriendFamilies = new FamilyCollection();
	public FamilyCollection getFriendFamilies() { return (FamilyCollection)getAll("nFriendFamilies"); }
	public void addFriendFamily(Family o) { add("nFriendFamilies",o); }
	public void removeFriendFamily(Family o) { remove("nFriendFamilies",o); }
	
	@ConnectionN1(c="children")
	private Person parent;
	public Person getParent() { return (Person)getN1("parent"); }
	public Person setParent(Person o) { return (Person)setN1("parent",o); }

	@Connection1N(o="parent")
	private PersonCollection children = new PersonCollection();
	public PersonCollection getChildren() { return (PersonCollection)getAll("children"); }
	public void addChild(Person o) { add("children",o); }
	public void removeChild(Person o) { remove("children",o); }

	
}
